import 'package:binggo_bomb/commons/BodyTabWidget.dart';
import 'package:binggo_bomb/utils/localStorage.dart';
import 'package:flutter/material.dart';

import 'cardsList.dart';

class ColorCardsPage extends StatefulWidget {
  const ColorCardsPage({super.key});

  @override
  State<ColorCardsPage> createState() => _ColorCardsPageState();
}

class _ColorCardsPageState extends State<ColorCardsPage> {

  GlobalKey<CardsListPageState> sonState = GlobalKey<CardsListPageState>();

  int tabSelectIndex = 0;

  @override
  void initState() {
    super.initState();
  }


  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('BingGo Bomb', style: TextStyle(color: Colors.black87),),
        backgroundColor: Colors.transparent,
        elevation: 0.0,
        centerTitle: true,
        actions: <Widget>[
          IconButton(
              icon: const Icon(Icons.add, color: Colors.black87,),
              tooltip: 'liked_widget_bloc',
              onPressed: () {
                sonState.currentState?.addCard();
                // Map res = LocalStorage.getKey<Map>("pinkCards") as Map;
                // String i = (res.length+1).toString();
                // res[i] = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,];
                // LocalStorage.set<Map>('pinkCards', res);
                // setState(() {
                //   yellowCards = res;
                // });
                // Navigator.of(context).push(MaterialPageRoute(builder: (_) => PlayerPage()));
              }),
        ],
      ),
      body: Column(
        children: [
          CardsListPage(colorId: 0),
        ],
      ),
      // body: BodyTabWidget(),
    );
  }

}
